﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace ebMS3dotnet.Core.Configuration
{
    
    public class PMode:ConfigurationElement
    {
        [ConfigurationProperty("id",IsRequired=true, IsKey=true)]
        public string ID
        {
            get { return (string)base["id"]; }
        }

        [ConfigurationProperty("mep", IsRequired = true)]
        public string MEP
        {
            get { return (string)base["mep"]; }
        }

        [ConfigurationProperty("mepBinding", IsRequired = true)]
        public string MEPBinding
        {
            get { return (string)base["mepBinding"]; }
        }

        [ConfigurationProperty("address", IsRequired = true)]
        public string Address
        {
            get { return (string)base["address"]; }
        }

        [ConfigurationProperty("soapVersion", DefaultValue = "Soap11")]
        [TypeConverter(typeof(SoapVersionConverter))]
        public EnvelopeVersion SOAPVersion
        {
            get { return (EnvelopeVersion)base["soapVersion"]; }
        }

        [ConfigurationProperty("businessInfo")]
        public BusinessInfo BusinessInfo { get { return (BusinessInfo)base["businessInfo"]; } }

        [ConfigurationProperty("initiator")]
        public Initiator Initiator { get { return (Initiator)base["initiator"]; } }

        [ConfigurationProperty("responder")]
        public Responder Responder { get { return (Responder)base["responder"]; } }
    }

    public class BusinessInfo:ConfigurationElement
    {
        [ConfigurationProperty("mpc")]
        public string Mpc { get { return (string)base["mpc"]; } }

        [ConfigurationProperty("service")]
        public string Service { get { return (string)base["service"]; } }

        [ConfigurationProperty("action")]
        public string Action { get { return (string)base["action"]; } }
    }

    public class Initiator:ConfigurationElement
    {
        [ConfigurationProperty("party")]
        public string Party { get { return (string)base["party"]; } }

        [ConfigurationProperty("role")]
        public string Role { get { return (string)base["role"]; } }
    }

    public class Responder:ConfigurationElement
    {
        [ConfigurationProperty("party")]
        public string Party { get { return (string)base["party"]; } }

        [ConfigurationProperty("role")]
        public string Role { get { return (string)base["role"]; } }
    }
}
